﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sdtpsnodedemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            try
            {
                GRPCServer.GRPCServer.viewctrl = richTextBox1;
                string msg = GRPCServer.GRPCServer.StartServer();
                richTextBox1.Text += "\r\n";
                richTextBox1.Text += string.Format("{0}\t{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), msg);// StartServer();
                richTextBox1.Text += "开启成功";

            }
            catch (Exception cw)
            {
                richTextBox1.Text = cw.Message + "\r\n" + cw.StackTrace;
            }
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            GRPCServer.GRPCServer.StopServer();
        }
    }
}
